﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class TestConnectionPanel : BasePanel
{
	public InputField numberInputField;
	public Button sendRequestBtn;
	public Text respText;

	private TestConnectionRequest _testConnectionRequest;
	
	
	 void Start()
	{
		//按钮事件函数绑定
		sendRequestBtn.onClick.AddListener(delegate { SendRequestButtonClicked(); });
		
		//request对象初始化
		_testConnectionRequest = this.gameObject.GetComponent<TestConnectionRequest>();
	}


	 private void SendRequestButtonClicked()
	 {
		 _testConnectionRequest.SendRequest(int.Parse(numberInputField.text)); 
	 }

	public override void OnEnter()
	{
		
	}

	public override void OnPause()
	{
		
	}

	public override void OnResume()
	{
		
	}

	public override void OnExit()
	{
		
	}

	public void HandleResponse(string data)
	{
		respText.text = data;
	}
}
